var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2pvzChannel = require("pvzChannel");
var $2UIManager = require("UIManager");
var $2UserDataManager = require("UserDataManager");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_SharePanelUI = /* */function (_cc$Component64) {
  babel_inherits(c, _cc$Component64);
  var _super80 = babel_createSuper(c);
  function c() {
    var _this188;
    babel_classCallCheck(this, c);
    _this188 = _super80.apply(this, arguments);
    _this188.rewardNum = null;
    _this188.titleLabel = null;
    return _this188;
  }
  babel_createClass(c, [{
    key: "onLoad",
    value: function onLoad() {
      if ($2UserDataManager.default.instance.shareReward) {
        this.rewardNum.string = "+100";
      } else {
        this.rewardNum.string = "+20";
      }
    }
  }, {
    key: "init",
    value: function init(e) {
      this.titleLabel.string = 0 == e ? "技术惊人！分享给你的朋友们看看！" : "你的厨艺惊人，治好了我的精神内耗！";
    }
  }, {
    key: "onClickShareBtn",
    value: function onClickShareBtn() {
      var _this189 = this;
      $2pvzChannel.pvzChannel.instance().shareVideo(function () {
        if ($2UserDataManager.default.instance.shareReward) {
          $2UserDataManager.default.instance.shareReward = false;
          $2UserDataManager.default.instance.diamond += 100;
        } else {
          $2UserDataManager.default.instance.diamond += 20;
        }
        _this189.onClickClose();
      });
    }
  }, {
    key: "onClickClose",
    value: function onClickClose() {
      $2UIManager.default.instance.closeUI("SharePanelUI");
    }
  }]);
  return c;
}(cc.Component);
cc__decorate([ccp_property(cc.Label)], def_SharePanelUI.prototype, "rewardNum", undefined);
cc__decorate([ccp_property(cc.Label)], def_SharePanelUI.prototype, "titleLabel", undefined);
def_SharePanelUI = cc__decorate([ccp_ccclass], def_SharePanelUI);
exports.default = def_SharePanelUI;